<link rel="stylesheet" href="/static/admin/layui/css/layui.css">
<style>
	#edit{padding: 10px;}
	.layui-form-label{width: 60px;}
	.layui-input-block{margin-left: 90px;}
</style>

<form id="edit" class="layui-form">
	<div class="layui-form-item">
		<label class="layui-form-label">等级描述</label>
		<div class="layui-input-block">
			<input type="text" name="remarks" v-model="info.remarks" required placeholder="请输入等级描述信息" class="layui-input">
		</div>
	</div>
</form>

<script src="/static/admin/js/jquery.min.js"></script>
<script src="/static/admin/layer/layer.js"></script>
<script src="/static/admin/layui/layui.js"></script>
<script src="/static/admin/js/h.js"></script>
<script src="/static/admin/eleme/vue.js"></script>
<script>
layui.use('form',function(){
	var form = layui.form;
	vm = new Vue({
		el: '#edit',
		data: {
			info: {
				{% for k,v in info %}
				{% if k!=='gradepermission' %}
				{{ k }}:"{{ v }}",
				{% endif %}
				{% endfor %}
			}
		}
	})
})
function call_submit(index){
	if (/^\s+$/.test(vm.info.remarks)) {
		layer.msg('请输入等级描述信息', {icon:2, time:2000});
		return false;
	}
	H.ajax('/admin/fenpei/edit',vm.info,'post',function(res){
		parent.layer.msg(res.data, {icon:1, time:2000});
		setTimeout(function(){
			parent.refresh();
			parent.layer.close(index);
		}, 2000)
	})
}
</script>